-
Notifications
You must be signed in to change notification settings - Fork 12
add logic to ensure that the hooks inside of the woocommerce/src/ are parsed #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… being parsed and add some steps to run this site locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the local environment didn't work for me - it comes up but it doesn't have any of the actual file references. This isn't critical if you know it's working for you, but maybe we should screenshare to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @piinthecloud!
Thanks for the PR 💯. It works beautifully and I can confirm that the missing hooks are now present in the docs.
As for the local script, I left some small suggestions. Nothing's really a blocker, though. Please let me know what you think! Thanks again!
@jorgeatorres any additional concerns? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This works great. Thank you @piinthecloud and apologies for the delay in finishing the review!
This PR enhances the WooCommerce Code Reference Generator to support local development workflows by and improving the recursive file scanning to detect hooks in woocommerce/src and deeper subdirectories.
Expanded file parsing
Added
woocommerce/src
to parsed files: The logic ingenerate-hook-docs.php
has been updated to know also look insidewoocommerce/src
to detect hooks and filters in use.Fixed
generate-hook-docs.php
recursion: During testing, I detected that thegetFiles()
function wasn't going deep enough into the directories to appropriately retrieve all hook references. I simplified the logic on line 113 to directly merge the files from each subdirectory directly into the$files
array.Hook and filter detection: Increased from 1,732 to 2,580 hooks.
Local development
To facilitate development, I've added the
run-local.sh
which lets you easily set up a local server with a local copy of the docs.Tweaks
Updated the .gitignore to ensure linked
/woocommerce
files never get committed.